package com.anc.platform.config;

import com.anc.platform.bloomFilter.BloomFilterInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class PlatFormMvcConfig extends WebMvcConfigurationSupport {

    @Autowired
    private BloomFilterInterceptor bloomFilterInterceptor;
    @Autowired
    private SignAuthInterceptor signAuthInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(bloomFilterInterceptor).addPathPatterns("/**").excludePathPatterns("/auth/403", "/actuator/health");
       //registry.addInterceptor(signAuthInterceptor).addPathPatterns("/**").excludePathPatterns("/auth/403", "/actuator/health");
//        registry.addInterceptor(bloomFilterInterceptor).addPathPatterns("/supplychain/api/**").excludePathPatterns("/auth/403", "/actuator/health");
    }

}
